Computers / Programming / Projects / Code Formatter / Line

Defines a line to be included in the output.

Code

Line.h

h type icon
Type: Header file
Language: C++
Line.h

Line.cpp

cpp type icon
Type: Code file
Language: C++
Line.cpp

The Line class has two properties. Number is the number of the line from the parsed file that this object represents and content is the formatted representation of that line. These lines are generated as the file is parsed and then Line’s two methods are used to generate the final HTML to include in the output file.

The FormatNumber(bool first) method formats the line number. This involves putting the line number value in a row and cell div. If first is true then the row uses the “codeCountRowFirst” class which has slightly different styling.

The FormatContent(bool first) method formats the contents.This involves putting the conent in a row and cell div. If first is true then the row uses the “codeTextRowFirst” class which has slightly different styling.